package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SystemDictTypeMapper;
import com.ruoyi.system.domain.SystemDictType;
import com.ruoyi.system.service.ISystemDictTypeService;

/**
 * 字典类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-07
 */
@Service
public class SystemDictTypeServiceImpl implements ISystemDictTypeService 
{
    @Autowired
    private SystemDictTypeMapper systemDictTypeMapper;

    /**
     * 查询字典类型
     * 
     * @param id 字典类型主键
     * @return 字典类型
     */
    @Override
    public SystemDictType selectSystemDictTypeById(Long id)
    {
        return systemDictTypeMapper.selectSystemDictTypeById(id);
    }

    /**
     * 查询字典类型列表
     * 
     * @param systemDictType 字典类型
     * @return 字典类型
     */
    @Override
    public List<SystemDictType> selectSystemDictTypeList(SystemDictType systemDictType)
    {
        return systemDictTypeMapper.selectSystemDictTypeList(systemDictType);
    }

    /**
     * 新增字典类型
     * 
     * @param systemDictType 字典类型
     * @return 结果
     */
    @Override
    public int insertSystemDictType(SystemDictType systemDictType)
    {
        systemDictType.setCreateTime(DateUtils.getNowDate());
        return systemDictTypeMapper.insertSystemDictType(systemDictType);
    }

    /**
     * 修改字典类型
     * 
     * @param systemDictType 字典类型
     * @return 结果
     */
    @Override
    public int updateSystemDictType(SystemDictType systemDictType)
    {
        systemDictType.setUpdateTime(DateUtils.getNowDate());
        return systemDictTypeMapper.updateSystemDictType(systemDictType);
    }

    /**
     * 批量删除字典类型
     * 
     * @param ids 需要删除的字典类型主键
     * @return 结果
     */
    @Override
    public int deleteSystemDictTypeByIds(Long[] ids)
    {
        return systemDictTypeMapper.deleteSystemDictTypeByIds(ids);
    }

    /**
     * 删除字典类型信息
     * 
     * @param id 字典类型主键
     * @return 结果
     */
    @Override
    public int deleteSystemDictTypeById(Long id)
    {
        return systemDictTypeMapper.deleteSystemDictTypeById(id);
    }
}
